﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using WoSoft.PACS.Win.MyToolBars;

namespace WoSoft.PACS.Win.Forms
{
    public partial class FrmFirstPage : FrmBase
    {
        public FrmFirstPage()
        {
            InitializeComponent();
        }

        public FrmFirstPage(RibbonBar ribar)
            : base(ribar)
        {
            InitializeComponent();
        }

        public override List<OperationModel> Operations()
        {

            List<OperationModel> opts = new List<OperationModel>();

            var refreshBtn = new OperationModel()
            {
                ID = Guid.NewGuid().ToString(),
                Name = "刷新(&R)",
                GroupName = "首页操作",
                Image = global::WoSoft.PACS.Win.Properties.Resources.refresh,
                ClickEvent = RefreshClick
            };
            opts.Add(refreshBtn);

            return opts;
        }

        private void RefreshClick(object sender, EventArgs e)
        {
            //MessageBox.Show("刷新");
        }

        #region 快速连接
        //打开工作站
        private void btnItemWorker_Click(object sender, EventArgs e)
        {
            var mainFrm = this.Tag as FrmMain;
            if (mainFrm != null)
            {
                mainFrm.CallDoctorWorkerNew();
            }
        }

        private void buttonItemReportPacs_Click(object sender, EventArgs e)
        {
            var mainFrm = this.Tag as FrmMain;
            if (mainFrm != null)
            {
                mainFrm.CallReportPacs();
            }
        }

        private void buttonItemReportLIS_Click(object sender, EventArgs e)
        {
            var mainFrm = this.Tag as FrmMain;
            if (mainFrm != null)
            {
                mainFrm.CallReportLis();
            }
        }

        #endregion

        private void FrmFirstPage_Load(object sender, EventArgs e)
        {
            //if (object.Equals(null, Program.CurrentLoginUser))
            //{
            //    buttonItemReportPacs_Click(null, null);
            //    return;
            //}
            if (Program.CurrentLoginUser.Role == "doctor_ck")
                btnItemWorker.Visible = false;
        }
    }
}
